1000 |
It is possible to clip the bar's caption to bar, when the time scale is changed
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,48) oChart:FirstVisibleDate := "12/27/2000" oBar := oChart:Bars:Item("Task") oBar:Pattern := 32/*exPatternBox*/ oBar:Height := 13 oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K1","This is a bit of text that get's clipped") oItems:SetProperty("ItemBar",h,"K1",4/*exBarHAlignCaption*/,4) oItems:SetProperty("ItemBar",h,"K1",6/*exBarToolTip*/,oItems:ItemBar(h,"K1",3/*exBarCaption*/)) h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K1","This is a bit of text that is not clipped") oItems:SetProperty("ItemBar",h,"K1",4/*exBarHAlignCaption*/,1) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
999 |
How can I change the color for all bars with the key matching a pattern
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,64) oG2antt:Debug := .T. oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","A") oItems:AddBar(h,"Task","01/05/2001","01/07/2001","B1") oItems:AddBar(h,"Task","01/08/2001","01/17/2001","B2") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K3") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","B4") oItems:SetProperty("ItemBar",0,"<B*>",33/*exBarColor*/,255) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
998 |
How can I change the color for all bars in the same item with the key matching a pattern
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,64) oG2antt:Debug := .T. oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","A") oItems:AddBar(h,"Task","01/05/2001","01/07/2001","B1") oItems:AddBar(h,"Task","01/08/2001","01/17/2001","B2") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K3") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K4") oItems:SetProperty("ItemBar",h,"<B*>",33/*exBarColor*/,255) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
997 |
How can I change the color for all bars in the same item
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(h,"Task","01/05/2001","01/07/2001","K2") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K3") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K4") oItems:SetProperty("ItemBar",h,"<*>",33/*exBarColor*/,255) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
996 |
How can I write a special number for each date related to a bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL oNote,oNote1,oNote2,oNote3,oNote4,oNote5 LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,32) oChart:LevelCount := 2 oItems := oG2antt:Items() h := oItems:AddItem("Task") oItems:AddBar(h,"Task","01/02/2001","01/13/2001","1") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("N1",oG2antt:Items():FirstVisibleItem(),"1","") oNote:RelativePosition := "S+2" oNote:SetProperty("PartText",0/*exNoteStart*/,"4") oNote:SetProperty("PartFixedWidth",0/*exNoteStart*/,18) oNote:SetProperty("PartHOffset",0/*exNoteStart*/,-9) oNote:SetProperty("PartBackColor",0/*exNoteStart*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. )) oNote:ShowLink := 0/*exNoteLinkHidden*/ oNote:SetProperty("PartVisible",0/*exNoteStart*/,.T.) oNote1 := oNotes:Add("N2",oG2antt:Items():FirstVisibleItem(),"1","") oNote1:RelativePosition := "S+3" oNote1:SetProperty("PartText",0/*exNoteStart*/,"4") oNote1:SetProperty("PartFixedWidth",0/*exNoteStart*/,18) oNote1:SetProperty("PartHOffset",0/*exNoteStart*/,-9) oNote1:SetProperty("PartBackColor",0/*exNoteStart*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. )) oNote1:ShowLink := 0/*exNoteLinkHidden*/ oNote1:SetProperty("PartVisible",0/*exNoteStart*/,.T.) oNote2 := oNotes:Add("N3",oG2antt:Items():FirstVisibleItem(),"1","") oNote2:RelativePosition := "S+4" oNote2:SetProperty("PartText",0/*exNoteStart*/,"5") oNote2:SetProperty("PartFixedWidth",0/*exNoteStart*/,18) oNote2:SetProperty("PartHOffset",0/*exNoteStart*/,-9) oNote2:SetProperty("PartBackColor",0/*exNoteStart*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. )) oNote2:ShowLink := 0/*exNoteLinkHidden*/ oNote2:SetProperty("PartVisible",0/*exNoteStart*/,.T.) oNote3 := oNotes:Add("N4",oG2antt:Items():FirstVisibleItem(),"1","") oNote3:RelativePosition := "S+5" oNote3:SetProperty("PartText",0/*exNoteStart*/,"5") oNote3:SetProperty("PartFixedWidth",0/*exNoteStart*/,18) oNote3:SetProperty("PartHOffset",0/*exNoteStart*/,-9) oNote3:SetProperty("PartBackColor",0/*exNoteStart*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. )) oNote3:ShowLink := 0/*exNoteLinkHidden*/ oNote3:SetProperty("PartVisible",0/*exNoteStart*/,.T.) oNote4 := oNotes:Add("N5",oG2antt:Items():FirstVisibleItem(),"1","") oNote4:RelativePosition := "S+6" oNote4:SetProperty("PartText",0/*exNoteStart*/,"8") oNote4:SetProperty("PartFixedWidth",0/*exNoteStart*/,18) oNote4:SetProperty("PartHOffset",0/*exNoteStart*/,-9) oNote4:SetProperty("PartBackColor",0/*exNoteStart*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oNote4:ShowLink := 0/*exNoteLinkHidden*/ oNote4:SetProperty("PartVisible",0/*exNoteStart*/,.T.) oNote5 := oNotes:Add("Z",oG2antt:Items():FirstVisibleItem(),"1","") oNote5:RelativePosition := "E" oNote5:SetProperty("PartText",0/*exNoteStart*/,"4") oNote5:SetProperty("PartFixedWidth",0/*exNoteStart*/,18) oNote5:SetProperty("PartHOffset",0/*exNoteStart*/,-9) oNote5:SetProperty("PartBackColor",0/*exNoteStart*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,128,0 } ) , .F. )) oNote5:SetProperty("PartCanMove",0/*exNoteStart*/,.T.) oNote5:ShowLink := 0/*exNoteLinkHidden*/ oNote5:SetProperty("PartVisible",0/*exNoteStart*/,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
995 |
How can I assign a note to be always in the center of the bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNote LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","1") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("Note",oG2antt:Items():FirstVisibleItem(),"1","") oNote:RelativePosition := 0.5 oNote:SetProperty("PartText",0/*exNoteStart*/,"note<br>center") oNote:SetProperty("PartBackColor",0/*exNoteStart*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. )) oNote:SetProperty("PartVisible",1/*exNoteEnd*/,.F.) oNote:ShowLink := 0/*exNoteLinkHidden*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
994 |
How can I assign a note relative to the start of the bar, and let it be movable
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNote LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","1") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("Note",oG2antt:Items():FirstVisibleItem(),"1","") oNote:RelativePosition := "S+1" oNote:SetProperty("PartText",0/*exNoteStart*/,"<%d%>") oNote:SetProperty("PartFixedWidth",0/*exNoteStart*/,18) oNote:SetProperty("PartHOffset",0/*exNoteStart*/,9) oNote:SetProperty("PartCanMove",0/*exNoteStart*/,.T.) oNote:SetProperty("PartBackColor",0/*exNoteStart*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. )) oNote:SetProperty("PartVisible",1/*exNoteEnd*/,.F.) oNote:ShowLink := 0/*exNoteLinkHidden*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
993 |
How can I associate a note relative to the start of the bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNote LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","1") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("Note",oG2antt:Items():FirstVisibleItem(),"1","") oNote:RelativePosition := "S+1" oNote:SetProperty("PartText",0/*exNoteStart*/,"<%d%>") oNote:SetProperty("PartFixedWidth",0/*exNoteStart*/,18) oNote:SetProperty("PartHOffset",0/*exNoteStart*/,9) oNote:SetProperty("PartBackColor",0/*exNoteStart*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. )) oNote:SetProperty("PartVisible",1/*exNoteEnd*/,.F.) oNote:ShowLink := 0/*exNoteLinkHidden*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
992 |
How can I associate a note relative to the end of the bar, so if the bar is resized at the end, the not is moved accordingly
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNote LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","1") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("Note",oG2antt:Items():FirstVisibleItem(),"1","") oNote:RelativePosition := "E-1" oNote:SetProperty("PartText",0/*exNoteStart*/,"<%d%>") oNote:SetProperty("PartFixedWidth",0/*exNoteStart*/,18) oNote:SetProperty("PartHOffset",0/*exNoteStart*/,9) oNote:SetProperty("PartVisible",1/*exNoteEnd*/,.F.) oNote:ShowLink := 0/*exNoteLinkHidden*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
991 |
How can I associate a note relative to the end of the bar, so if the bar is resized at the end, the not is moved accordingly
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNote LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","1") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("Note",oG2antt:Items():FirstVisibleItem(),"1","") oNote:RelativePosition := 1 oNote:SetProperty("PartText",0/*exNoteStart*/,"End") oNote:SetProperty("PartVisible",1/*exNoteEnd*/,.F.) oNote:ShowLink := 0/*exNoteLinkHidden*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
990 |
How can I hide a bar without removing it
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,128) oChart:LevelCount := 2 oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001","B1") oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/06/2001","01/14/2001","B2") oItems:AddLink("L1",oItems:FindItem("Item 1",0),"B1",oItems:FindItem("Item 2",0),"B2") oItems:SetProperty("ItemBar",oItems:FirstVisibleItem(),oItems:FirstItemBar(oItems:FirstVisibleItem()),19/*exBarTransparent*/,100) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
989 |
How can I align the caption in the note
|
988 |
How I can assign a note and let user move the note relative to the bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNote LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","1") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("Note",oG2antt:Items():FirstVisibleItem(),"1","End") oNote:SetProperty("PartText",0/*exNoteStart*/,"Day<br> <%dd%>") oNote:SetProperty("PartCanMove",0/*exNoteStart*/,.T.) oNote:SetProperty("PartVOffset",0/*exNoteStart*/,16) oNote:SetProperty("PartTransparency",0/*exNoteStart*/,30) oNote:SetProperty("PartToolTip",0/*exNoteStart*/,"Click the note and start moving to a new position.") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
987 |
How can I assign a picture as a note associated with a bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNote,oNote1 LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif") oG2antt:SetProperty("HTMLPicture","pic2","c:\exontrol\images\auction.gif") oG2antt:AntiAliasing := .T. oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","1") h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","01/07/2001","01/11/2001","2") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("1",oG2antt:Items():ItemByIndex(0),"1","<img>pic1</img>") oNote:SetProperty("PartShadow",1/*exNoteEnd*/,.F.) oNote:SetProperty("PartBorderSize",1/*exNoteEnd*/,0) oNote:ClearPartBackColor(1/*exNoteEnd*/) oNote:SetProperty("PartHOffset",1/*exNoteEnd*/,-64) oNote:SetProperty("PartCanMove",1/*exNoteEnd*/,.T.) oNote1 := oNotes:Add("2",oG2antt:Items():ItemByIndex(1),"2","<img>pic2</img>") oNote1:SetProperty("PartShadow",1/*exNoteEnd*/,.F.) oNote1:SetProperty("PartBorderSize",1/*exNoteEnd*/,0) oNote1:ClearPartBackColor(1/*exNoteEnd*/) oNote1:RelativePosition := 1 oNote1:SetProperty("PartCanMove",1/*exNoteEnd*/,.T.) oNote1:SetProperty("LinkColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oNote1:LinkWidth := 2 oNote1:LinkStyle := 2/*exLinkDot*/ oNote1:ShowLink := 1/*exNoteLinkVisible*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
986 |
How can I assign a picture as a note associated with a bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNote,oNote1 LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=") oG2antt:AntiAliasing := .T. oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","1") h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","01/07/2001","01/11/2001","2") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("1",oG2antt:Items():ItemByIndex(0),"1","<img>1</img>") oNote:SetProperty("PartShadow",1/*exNoteEnd*/,.F.) oNote:SetProperty("PartBorderSize",1/*exNoteEnd*/,0) oNote:ClearPartBackColor(1/*exNoteEnd*/) oNote1 := oNotes:Add("2",oG2antt:Items():ItemByIndex(1),"2","<img>2</img>...<img>3</img>") oNote1:SetProperty("PartShadow",1/*exNoteEnd*/,.F.) oNote1:SetProperty("PartBorderSize",1/*exNoteEnd*/,0) oNote1:ClearPartBackColor(1/*exNoteEnd*/) oNote1:RelativePosition := 1 oNote1:SetProperty("PartCanMove",1/*exNoteEnd*/,.T.) oNote1:SetProperty("LinkColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oNote1:LinkWidth := 2 oNote1:LinkStyle := 2/*exLinkDot*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
985 |
How can I put a box assigned to a DATE
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNote,oNote1 LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Item 1") h := oItems:AddItem("Item 2") oNotes := oG2antt:Chart():Notes() oNote := oNotes:Add("D1",oG2antt:Items():FirstVisibleItem(),oG2antt:Chart():FirstVisibleDate(),"Date:<br><%dd%>/<%mm%><br><b><%yyyy%></b>") oNote:SetProperty("PartCanMove",1/*exNoteEnd*/,.T.) oNote:SetProperty("PartVOffset",1/*exNoteEnd*/,20) oNote:SetProperty("PartHOffset",1/*exNoteEnd*/,20) oNote1 := oNotes:Add("D2",oG2antt:Items():NextVisibleItem(oG2antt:Items():FirstVisibleItem()),"01/07/2001","Date:<br><%dd%>/<%mm%><br><b><%yyyy%></b>") oNote1:SetProperty("PartVisible",0/*exNoteStart*/,.T.) oNote1:SetProperty("PartText",0/*exNoteStart*/,"<b><%d%></b>") oNote1:SetProperty("PartCanMove",1/*exNoteEnd*/,.T.) oNote1:SetProperty("PartVOffset",1/*exNoteEnd*/,20) oNote1:SetProperty("PartHOffset",1/*exNoteEnd*/,20) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
984 |
How can I add a note or a box associated with a bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL oNotes LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","1","Center") oItems:SetProperty("ItemBar",h,"1",44/*exBarExtraCaption*/,"left") oItems:SetProperty("ItemBar",h,"1",45/*exBarExtraCaptionHAlign*/,16) h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","01/07/2001","01/11/2001","2","Center") oItems:SetProperty("ItemBar",h,"2",44/*exBarExtraCaption*/,"right") oItems:SetProperty("ItemBar",h,"2",45/*exBarExtraCaptionHAlign*/,18) oNotes := oG2antt:Chart():Notes() oNotes:Add("1S",oG2antt:Items():FirstVisibleItem(),"1","Start") oNotes:Add("1F",oG2antt:Items():FirstVisibleItem(),"1","End"):RelativePosition := 1 oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
983 |
Is it possible to define different working hours for every week day
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL oLevel,oLevel1 LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,14) oChart:NonworkingDays := 0 oChart:NonworkingHours := 0 oChart:FirstVisibleDate := "01/01/2001" oChart:LevelCount := 2 oLevel := oChart:Level(0) oLevel:Alignment := 1/*CenterAlignment*/ oLevel:Label := "<%dddd%>" oLevel1 := oChart:Level(1) oLevel1:Label := "<%hh%>" oLevel1:Count := 6 oChart:UnitWidth := 16 oG2antt:Columns():Add("") oItems := oG2antt:Items() h := oItems:AddItem(1) oItems:SetProperty("ItemNonworkingUnits",h,.F.,"weekday(value) != 1 or (weekday(value) = 1 and not ( hour(value) >= 9 and hour(value) <= 14 ))") h := oItems:AddItem(2) oItems:SetProperty("ItemNonworkingUnits",h,.F.,"weekday(value) = 2 and ( hour(value) >= 9 and hour(value) <= 14 )") h := oItems:AddItem(3) oItems:SetProperty("ItemNonworkingUnits",h,.F.,"weekday(value) = 3") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
982 |
How can I automatically update the exBarPercent value using a slider control
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL i oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Items():AllowCellValueToItemBar := .T. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2002" oChart:SetProperty("PaneWidth",.F.,128) oChart:Bars():Add("Task%Progress"):Shortcut := "Percent" oColumn := oG2antt:Columns():Add("Percent") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,518) oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"P") oItems := oG2antt:Items() i := oItems:AddItem(0) oItems:SetProperty("CellBold",i,0,.T.) oItems:CellEditor(i,0):EditType := 20/*SliderType*/ oItems:AddBar(i,"Percent","01/02/2002","01/06/2002","P") oItems:SetProperty("ItemBar",i,"P",14/*exBarShowPercentCaption*/,.T.) oItems:SetProperty("CellValue",i,0,50) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
981 |
Is there any automatic way to change a property for all bars in the chart
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K2") oItems:AddBar(oItems:AddItem("Task 3"),"Task","01/02/2001","01/04/2001","K3") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K4") oItems:SetProperty("ItemBar",0,"<*>",33/*exBarColor*/,255) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
980 |
How can I assign an icon to a bar and I get notified when I click it
|
979 |
How can I assign an icon to a bar so I do not break its caption
|
978 |
How can I assign multiple lables to the same bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","01/05/2001","01/07/2001","","Right") oItems:SetProperty("ItemBar",h1,"",4/*exBarHAlignCaption*/,18) oItems:AddBar(h1,"","01/05/2001","01/05/2001","T1","Left") oItems:SetProperty("ItemBar",h1,"T1",4/*exBarHAlignCaption*/,16) oItems:AddBar(h1,"","01/05/2001","01/07/2001","T2","Center") oItems:GroupBars(h1,"",.T.,h1,"T1",.T.) oItems:GroupBars(h1,"",.T.,h1,"T1",.F.) oItems:GroupBars(h1,"",.T.,h1,"T2",.T.) oItems:GroupBars(h1,"",.F.,h1,"T2",.F.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
977 |
Is there any way to have more Captions on a bar than one
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","01/05/2001","01/07/2001","","Right") oItems:SetProperty("ItemBar",h1,"",4/*exBarHAlignCaption*/,18) oItems:AddBar(h1,"","01/05/2001","01/05/2001","T1","Left") oItems:SetProperty("ItemBar",h1,"T1",4/*exBarHAlignCaption*/,16) oItems:GroupBars(h1,"",.T.,h1,"T1",.T.) oItems:GroupBars(h1,"",.T.,h1,"T1",.F.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
976 |
How can I assign multiple lables to the same bar at once
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","","Center") oItems:SetProperty("ItemBar",h,"",44/*exBarExtraCaption*/,"left") oItems:SetProperty("ItemBar",h,"",45/*exBarExtraCaptionHAlign*/,16) h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","01/07/2001","01/11/2001","","Center") oItems:SetProperty("ItemBar",h,"",44/*exBarExtraCaption*/,"right") oItems:SetProperty("ItemBar",h,"",45/*exBarExtraCaptionHAlign*/,18) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
975 |
How can I limit the duration or length of the bar
|
974 |
I have an EBN file how can I apply different colors to it, so no need to create a new one
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h,hC oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn") oG2antt:SetProperty("SelBackColor",oG2antt:BackColor()) oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor()) oG2antt:HasLines := 0/*exNoLine*/ oG2antt:Columns():Add("Default") oItems := oG2antt:Items() h := oItems:AddItem("Root") hC := oItems:InsertItem(h,,"Default") oItems:SetProperty("ItemBackColor",hC,0x1000000) oItems:SetProperty("ItemHeight",oItems:InsertItem(h,,""),6) hC := oItems:InsertItem(h,,"Light Green") oItems:SetProperty("ItemBackColor",hC,0x100ff00) oG2antt:Chart():SetProperty("ItemBackColor",hC,0x100ff00) oItems:SetProperty("ItemHeight",oItems:InsertItem(h,,""),6) hC := oItems:InsertItem(h,,"Dark Green") oItems:SetProperty("ItemBackColor",hC,0x1007f00) oItems:SetProperty("ItemHeight",oItems:InsertItem(h,,""),6) hC := oItems:InsertItem(h,,"Magenta") oItems:SetProperty("ItemBackColor",hC,0x1ff7fff) oItems:SetProperty("ItemHeight",oItems:InsertItem(h,,""),6) hC := oItems:InsertItem(h,,"Yellow") oItems:SetProperty("ItemBackColor",hC,0x17fffff) oItems:SetProperty("ItemHeight",oItems:InsertItem(h,,""),6) oItems:SetProperty("ExpandItem",h,.T.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
973 |
I need to specify the non-working hours for about 100 days for each item, but the scrolling is very slow. Is there any option to increase the speed
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:AllowChartScrollPage := .T. oG2antt:Columns():Add("Non-Work") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "04/04/2009 16:00:00" oChart:SetProperty("PaneWidth",.F.,52) oChart:LevelCount := 2 oChart:UnitWidth := 16 oLevel := oChart:Level(0) oLevel:Label := "<r><%d%>-<%mmm%>" oLevel:Unit := 4096/*exDay*/ oLevel1 := oChart:Level(1) oLevel1:Label := "<%hh%>" oLevel1:Unit := 65536/*exHour*/ oLevel1:Count := 2 oItems := oG2antt:Items() oItems:AddItem("Default") oItems:SetProperty("ItemNonworkingUnits",oItems:AddItem("Test"),.F.,"date(shortdate(value)) case(default:0;#4/5/2009# : hour(value) >= 6 and hour(value) <= 12; #4/6/2009# : hour(value) >= 6 and hour(value) <= 12; #4/7/2009# : hour(value) >= 6 and hour(value) <= 12; #4/8/2009# : hour(value) >= 6 and hour(value) <= 12; #4/9/2009# : hour(value) >= 6 and hour(value) <= 12; #4/10/2009# : hour(value) >= 6 and hour(value) <= 12; #4/11/2009# : hour(value) >= 6 and hour(value) <= 12; #4/12/2009# : hour(value) >= 6 and hour(value) <= 12; #4/13/2009# : hour(value) >= 6 and hour(value)" +; " <= 12; #4/14/2009# : hour(value) >= 6 and hour(value) <= 12; #4/15/2009# : hour(value) >= 6 and hour(value) <= 12; #4/16/2009# : hour(value) >= 6 and hour(value) <= 12; #4/17/2009# : hour(value) >= 6 and hour(value) <= 12; #4/18/2009# : hour(value) >= 6 and hour(value) <= 12; #4/19/2009# : hour(value) >= 6 and hour(value) <= 12; #4/20/2009# : hour(value) >= 6 and hour(value) <= 12; #4/21/2009# : hour(value) >= 6 and hour(value) <= 12; #4/22/2009# : hour(value) >= 6 and hour(value) <= 12; #4/23/2009# : hour" +; "(value) >= 6 and hour(value) <= 12; #4/24/2009# : hour(value) >= 6 and hour(value) <= 12; #4/25/2009# : hour(value) >= 6 and hour(value) <= 12; #4/26/2009# : hour(value) >= 6 and hour(value) <= 12; #4/27/2009# : hour(value) >= 6 and hour(value) <= 12; #4/28/2009# : hour(value) >= 6 and hour(value) <= 12; #4/29/2009# : hour(value) >= 6 and hour(value) <= 12; #4/30/2009# : hour(value) >= 6 and hour(value) <= 12; #5/1/2009# : hour(value) >= 6 and hour(value) <= 12; #5/2/2009# : hour(value) >= 6 and hour(value)" +; " <= 12; #5/3/2009# : hour(value) >= 6 and hour(value) <= 12; #5/4/2009# : hour(value) >= 6 and hour(value) <= 12; #5/5/2009# : hour(value) >= 6 and hour(value) <= 12; #5/6/2009# : hour(value) >= 6 and hour(value) <= 12; #5/7/2009# : hour(value) >= 6 and hour(value) <= 12; #5/8/2009# : hour(value) >= 6 and hour(value) <= 12; #5/9/2009# : hour(value) >= 6 and hour(value) <= 12; #5/10/2009# : hour(value) >= 6 and hour(value) <= 12; #5/11/2009# : hour(value) >= 6 and hour(value) <= 12; #5/13/2009# : hour(value)" +; " >= 6 and hour(value) <= 12; #5/14/2009# : hour(value) >= 6 and hour(value) <= 12; #5/15/2009# : hour(value) >= 6 and hour(value) <= 12; #5/16/2009# : hour(value) >= 6 and hour(value) <= 12; #5/17/2009# : hour(value) >= 6 and hour(value) <= 12; #5/18/2009# : hour(value) >= 6 and hour(value) <= 12; #5/19/2009# : hour(value) >= 6 and hour(value) <= 12; #5/20/2009# : hour(value) >= 6 and hour(value) <= 12; #5/21/2009# : hour(value) >= 6 and hour(value) <= 12; #5/22/2009# : hour(value) >= 6 and hour(value) <= 1" +; "2; #5/23/2009# : hour(value) >= 6 and hour(value) <= 12; #5/24/2009# : hour(value) >= 6 and hour(value) <= 12; #5/25/2009# : hour(value) >= 6 and hour(value) <= 12; #5/26/2009# : hour(value) >= 6 and hour(value) <= 12; #5/27/2009# : hour(value) >= 6 and hour(value) <= 12; #5/28/2009# : hour(value) >= 6 and hour(value) <= 12; #5/29/2009# : hour(value) >= 6 and hour(value) <= 12; #5/30/2009# : hour(value) >= 6 and hour(value) <= 12; #5/31/2009# : hour(value) >= 6 and hour(value) <= 12; #6/1/2009# : hour(value" +; ") >= 6 and hour(value) <= 12; #6/2/2009# : hour(value) >= 6 and hour(value) <= 12; #6/3/2009# : hour(value) >= 6 and hour(value) <= 12; #6/4/2009# : hour(value) >= 6 and hour(value) <= 12; #6/5/2009# : hour(value) >= 6 and hour(value) <= 12; #6/6/2009# : hour(value) >= 6 and hour(value) <= 12; #6/7/2009# : hour(value) >= 6 and hour(value) <= 12; #6/8/2009# : hour(value) >= 6 and hour(value) <= 12; #6/9/2009# : hour(value) >= 6 and hour(value) <= 12; #6/10/2009# : hour(value) >= 6 and hour(value) <= 12; #6/1" +; "1/2009# : hour(value) >= 6 and hour(value) <= 12; #6/12/2009# : hour(value) >= 6 and hour(value) <= 12; #6/13/2009# : hour(value) >= 6 and hour(value) <= 12; #6/14/2009# : hour(value) >= 6 and hour(value) <= 12; #6/15/2009# : hour(value) >= 6 and hour(value) <= 12; #6/16/2009# : hour(value) >= 6 and hour(value) <= 12; #6/17/2009# : hour(value) >= 6 and hour(value) <= 12; #6/18/2009# : hour(value) >= 6 and hour(value) <= 12; #6/19/2009# : hour(value) >= 6 and hour(value) <= 12; #6/21/2009# : hour(value) >= 6" +; " and hour(value) <= 12; #6/22/2009# : hour(value) >= 6 and hour(value) <= 12; #6/23/2009# : hour(value) >= 6 and hour(value) <= 12; #6/24/2009# : hour(value) >= 6 and hour(value) <= 12; #6/25/2009# : hour(value) >= 6 and hour(value) <= 12; #6/26/2009# : hour(value) >= 6 and hour(value) <= 12; #6/27/2009# : hour(value) >= 6 and hour(value) <= 12; #6/28/2009# : hour(value) >= 6 and hour(value) <= 12; #6/29/2009# : hour(value) >= 6 and hour(value) <= 12; #6/30/2009# : hour(value) >= 6 and hour(value) <= 12; #7" +; "/1/2009# : hour(value) >= 6 and hour(value) <= 12; #7/2/2009# : hour(value) >= 6 and hour(value) <= 12; #7/3/2009# : hour(value) >= 6 and hour(value) <= 12; #7/4/2009# : hour(value) >= 6 and hour(value) <= 12; #7/5/2009# : hour(value) >= 6 and hour(value) <= 12; #7/6/2009# : hour(value) >= 6 and hour(value) <= 12; #7/7/2009# : hour(value) >= 6 and hour(value) <= 12; #7/8/2009# : hour(value) >= 6 and hour(value) <= 12; #7/9/2009# : hour(value) >= 6 and hour(value) <= 12; #7/10/2009# : hour(value) >= 6 and ho" +; "ur(value) <= 12; #7/11/2009# : hour(value) >= 6 and hour(value) <= 12; #7/12/2009# : hour(value) >= 6 and hour(value) <= 12; #7/13/2009# : hour(value) >= 6 and hour(value) <= 12; #7/14/2009# : hour(value) >= 6 and hour(value) <= 12)") oItems:SetProperty("ItemNonworkingUnits",oItems:AddItem("Test"),.F.,"date(shortdate(value)) case(default:0;#4/5/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/6/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/7/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/8/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/9/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/10/2009# : hour(value) >= 6 and hour(value) <" +; "= 10 or hour(value) in (16,17,20,21); #4/11/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/12/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/13/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/14/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/15/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/16/2009# : hour(value) >= 6 and hour(valu" +; "e) <= 10 or hour(value) in (16,17,20,21); #4/17/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/18/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/19/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/20/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/21/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/22/2009# : hour(value) >= 6 and hour(" +; "value) <= 10 or hour(value) in (16,17,20,21); #4/23/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/24/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/25/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/26/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/27/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/28/2009# : hour(value) >= 6 and h" +; "our(value) <= 10 or hour(value) in (16,17,20,21); #4/29/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #4/30/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/1/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/2/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/3/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/4/2009# : hour(value) >= 6 and h" +; "our(value) <= 10 or hour(value) in (16,17,20,21); #5/5/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/6/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/7/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/8/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/9/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/10/2009# : hour(value) >= 6 and ho" +; "ur(value) <= 10 or hour(value) in (16,17,20,21); #5/11/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/13/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/14/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/15/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/16/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/17/2009# : hour(value) >= 6 an" +; "d hour(value) <= 10 or hour(value) in (16,17,20,21); #5/18/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/19/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/20/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/21/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/22/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/23/2009# : hour(value) >= " +; "6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/24/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/25/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/26/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/27/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/28/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/29/2009# : hour(value)" +; " >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/30/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #5/31/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/1/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/2/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/3/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/4/2009# : hour(value)" +; " >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/5/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/6/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/7/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/8/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/9/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/10/2009# : hour(value) " +; ">= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/11/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/12/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/13/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/14/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/15/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/16/2009# : hour(val" +; "ue) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/17/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/18/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/19/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/21/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/22/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/23/2009# : hour" +; "(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/24/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/25/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/26/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/27/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/28/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/29/2009# : " +; "hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #6/30/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/1/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/2/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/3/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/4/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/5/2009# : h" +; "our(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/6/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/7/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/8/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/9/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/10/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/11/2009# : h" +; "our(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/12/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/13/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21); #7/14/2009# : hour(value) >= 6 and hour(value) <= 10 or hour(value) in (16,17,20,21))") oItems:AddItem("Default") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
972 |
How can I use the CASE statement (CASE usage)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oColumn := oG2antt:Columns():Add("Value") oColumn:Width := 24 oColumn:Editor():EditType := 4/*SpinType*/ oColumn1 := oG2antt:Columns():Add("CASE - statment") oColumn1:ComputedField := "%0 case (default:'not found';1:%0;2:2*%0;3:3*%0;4:4*%0;5:5*%0;7:'Seven';8:'Eight';9:'Nine';11:'Eleven';13:'Thirtheen';14:'Fourtheen')" oColumn1:ToolTip := oColumn1:ComputedField() oItems := oG2antt:Items() oItems:AddItem(0) oItems:AddItem(1) oItems:AddItem(2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
971 |
How can I use the CASE statement (CASE usage)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oColumn := oG2antt:Columns():Add("Value") oColumn:Width := 24 oColumn:Editor():EditType := 4/*SpinType*/ oColumn1 := oG2antt:Columns():Add("CASE - statment") oColumn1:ComputedField := "%0 case (default:'not found';1:'One';2:'Two';3:'Three';4:'Four';5:'Five';7:'Seven';8:'Eight';9:'Nine';11:'Eleven';13:'Thirtheen';14:'Fourtheen')" oColumn1:ToolTip := oColumn1:ComputedField() oItems := oG2antt:Items() oItems:AddItem(0) oItems:AddItem(1) oItems:AddItem(2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
970 |
I have seen the IN function but it returns -1 or 0. How can I display the value being found ( SWITCH usage )
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oColumn := oG2antt:Columns():Add("Value") oColumn:Width := 24 oColumn:Editor():EditType := 4/*SpinType*/ oColumn1 := oG2antt:Columns():Add("SWITCH - statment") oColumn1:ComputedField := "%0 switch ('not found', 1,2,3,4,5,7,8,9,11,13,14)" oColumn1:ToolTip := oColumn1:ComputedField() oItems := oG2antt:Items() oItems:AddItem(0) oItems:AddItem(1) oItems:AddItem(2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
969 |
I have a large collection of constant values and using or operator is a time consuming (IN usage). Is there any way to increase the speed to check if a value maches the collection
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oColumn := oG2antt:Columns():Add("Value") oColumn:Width := 24 oColumn:Editor():EditType := 4/*SpinType*/ oColumn1 := oG2antt:Columns():Add("IN - statment") oColumn1:ComputedField := "%0 in (1,2,3,4,5,7,8,9,11,13,14) ? 'found' : ''" oColumn1:ToolTip := oColumn1:ComputedField() oItems := oG2antt:Items() oItems:AddItem(0) oItems:AddItem(1) oItems:AddItem(2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
968 |
How can I automatically update the exBarPercent value using a slider control
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oEditor LOCAL oItems LOCAL i oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Items():AllowCellValueToItemBar := .T. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2002" oChart:SetProperty("PaneWidth",.F.,128) oChart:Bars():Add("Task%Progress"):Shortcut := "Percent" oColumn := oG2antt:Columns():Add("Percent") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,12) oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"P") oItems := oG2antt:Items() i := oItems:AddItem(0) oItems:SetProperty("CellBold",i,0,.T.) oEditor := oItems:CellEditor(i,0) oEditor:EditType := 20/*SliderType*/ oEditor:SetProperty("Option",42/*exSliderStep*/,0.01) oEditor:SetProperty("Option",40/*exSpinStep*/,0.01) oEditor:SetProperty("Option",44/*exSliderMax*/,1) oEditor:SetProperty("Option",41/*exSliderWidth*/,-100) oItems:SetProperty("CellValueFormat",i,0,1/*exHTML*/) oItems:AddBar(i,"Percent","01/02/2002","01/06/2002","P") oItems:SetProperty("ItemBar",i,"P",14/*exBarShowPercentCaption*/,.T.) oItems:SetProperty("CellValue",i,0,0.5) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
967 |
How can I automatically update the exBarPercent value using a spin control
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oEditor LOCAL oItems LOCAL i oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Items():AllowCellValueToItemBar := .T. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2002" oChart:SetProperty("PaneWidth",.F.,128) oChart:Bars():Add("Task%Progress"):Shortcut := "Percent" oColumn := oG2antt:Columns():Add("Percent") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,12) oColumn:FormatColumn := "((0:=round(dbl(%0)*100)) >= 50 ? '<font 8>'+ =:0 + '%</font>' : '<fgcolor=808080><font 6>'+ =:0 + '%</font></fgcolor>')" oItems := oG2antt:Items() i := oItems:AddItem(0) oItems:SetProperty("CellBold",i,0,.T.) oEditor := oItems:CellEditor(i,0) oEditor:EditType := 4/*SpinType*/ oEditor:SetProperty("Option",40/*exSpinStep*/,0.01) oEditor:SetProperty("Option",44/*exSliderMax*/,1) oItems:SetProperty("CellValueFormat",i,0,1/*exHTML*/) oItems:AddBar(i,"Percent","01/02/2002","01/06/2002") oItems:SetProperty("CellValue",i,0,0.5) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
966 |
How do I specify for an item all units as being non-working units
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:AllowChartScrollPage := .T. oG2antt:Columns():Add("Non-Work") oChart := oG2antt:Chart() oChart:AllowCreateBar := 1/*exCreateBarAuto*/ oChart:FirstVisibleDate := "04/03/2009 10:00:00" oChart:SetProperty("PaneWidth",.F.,64) oChart:LevelCount := 2 oChart:UnitWidth := 16 oLevel := oChart:Level(0) oLevel:Label := "<r><%d%>-<%mmm%>" oLevel:Unit := 4096/*exDay*/ oLevel1 := oChart:Level(1) oLevel1:Label := "<%hh%>" oLevel1:Unit := 65536/*exHour*/ oLevel1:Count := 2 oItems := oG2antt:Items() oItems:AddItem("Default") oItems:SetProperty("ItemNonworkingUnits",oItems:AddItem("All-Non-Working"),.F.,"1") oItems:AddItem("Default") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
965 |
How do I specify for an item all units as being working units
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:AllowChartScrollPage := .T. oG2antt:Columns():Add("Non-Work") oChart := oG2antt:Chart() oChart:AllowCreateBar := 1/*exCreateBarAuto*/ oChart:FirstVisibleDate := "04/03/2009 10:00:00" oChart:SetProperty("PaneWidth",.F.,64) oChart:LevelCount := 2 oChart:UnitWidth := 16 oLevel := oChart:Level(0) oLevel:Label := "<r><%d%>-<%mmm%>" oLevel:Unit := 4096/*exDay*/ oLevel1 := oChart:Level(1) oLevel1:Label := "<%hh%>" oLevel1:Unit := 65536/*exHour*/ oLevel1:Count := 2 oItems := oG2antt:Items() oItems:AddItem("Default") oItems:SetProperty("ItemNonworkingUnits",oItems:AddItem("All-Working"),.F.,"0") oItems:AddItem("Default") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
964 |
How can I programmatically specify different non-working units ( days, hours ) for different items
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL oLevel,oLevel1 LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:AllowChartScrollPage := .T. oG2antt:Columns():Add("Non-Work") oChart := oG2antt:Chart() oChart:AllowCreateBar := 1/*exCreateBarAuto*/ oChart:Bars():Add("Task:Split"):Shortcut := "Task" oChart:FirstVisibleDate := "07/13/2009 12:00:00" oChart:SetProperty("PaneWidth",.F.,52) oChart:LevelCount := 2 oChart:UnitWidth := 16 oLevel := oChart:Level(0) oLevel:Label := "<r><b><%d%></b> <%mmm%> <%yyyy%>" oLevel:Unit := 4096/*exDay*/ oLevel1 := oChart:Level(1) oLevel1:Label := "<%hh%>" oLevel1:Unit := 65536/*exHour*/ oLevel1:Count := 2 oItems := oG2antt:Items() h := oItems:AddItem("Item 1") oItems:SetProperty("ItemNonworkingUnits",h,.F.,"(shortdate(value) = #7/14/2009# and hour(value) >= 6 and hour(value) <= 12)") oItems:AddBar(h,"Task","07/14/2009 04:00:00","07/14/2009 14:00:00") h := oItems:AddItem("Item 2") oItems:SetProperty("ItemNonworkingUnits",h,.F.,"(((hour(value) >= 4 and hour(value) <= 16) or hour(value) = 2) and month(value) = 7) or ((hour(value) >= 2 and hour(value) < 10)) and month(value) = 6 or weekday(value) = 6") oItems:AddBar(h,"Task","07/14/2009 01:00:00","07/14/2009 06:00:00") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
963 |
I am programmatically select a date using the Chart.SelectDate property, but can't see why the date is not highlighted. What am I doing wrong
|
962 |
How do I show a shorter line in the chart's level
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oChart := oG2antt:Chart() oChart:DrawLevelSeparator := 0/*exLevelNoLine*/ oChart:UnitWidth := 24 oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oLevel := oChart:Level(0) oLevel:Alignment := 1/*CenterAlignment*/ oLevel:Label := "<%dddd%>" oLevel:DrawTickLines := 18/*exLevelLowerHalf+exLevelSolidLine*/ oLevel1 := oChart:Level(1) oLevel1:Label := 65536 oLevel1:Count := 6 oLevel1:DrawTickLines := 578/*0x200+exLevelMiddleLine+exLevelSolidLine*/ oLevel1:DrawTickLinesFrom(0,34/*exLevelUpperHalf+exLevelSolidLine*/) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
961 |
How do I replicate the screen shot http://www.exontrol.com/images/exg2antt9.jpg
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oBar LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oColumns LOCAL oItems LOCAL oLevel,oLevel1 LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oAppearance := oG2antt:VisualAppearance() oAppearance:Add(1,"C:\Program Files\Exontrol\ExG2antt.NET\Sample\EBN\headdark.ebn") oAppearance:Add(2,"C:\Program Files\Exontrol\ExG2antt.NET\Sample\EBN\xpbsel.ebn") oAppearance:Add(3,"C:\Program Files\Exontrol\ExG2antt.NET\Sample\EBN\headligh.ebn") oAppearance:Add(4,"CP:1 0 0 1 1") oG2antt:SetProperty("BackColorHeader",0x4000000) oG2antt:Chart():SetProperty("BackColorLevelHeader",0x4000000) oG2antt:SetProperty("SelBackColor",0x20000ff) oG2antt:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oG2antt:HeaderHeight := 22 oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oG2antt:MarkSearchColumn := .F. oG2antt:ScrollBySingleLine := .F. oG2antt:ShowFocusRect := .F. oG2antt:DefaultItemHeight := 48 oColumns := oG2antt:Columns() oColumn := oColumns:Add("Group") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:SetProperty("Def",4/*exCellBackColor*/,50331648) oColumn:LevelKey := 1 oColumn1 := oColumns:Add("Histogram") oColumn1:Width := 18 oColumn1:AllowSizing := .F. oColumn1:LevelKey := 1 oColumn1:Position := 0 oChart := oG2antt:Chart() oChart:FirstVisibleDate := "06/11/2009" oChart:DrawGridLines := -1/*exAllLines*/ oChart:SetProperty("PaneWidth",.F.,96) oChart:LevelCount := 2 oChart:DrawLevelSeparator := 0/*exLevelNoLine*/ oLevel := oChart:Level(0) oLevel:Label := "<%mmmm%> <%yyyy%>" oLevel:Unit := 16/*exMonth*/ oLevel:Alignment := 1/*CenterAlignment*/ oLevel1 := oChart:Level(1) oLevel1:FormatLabel := "weekday(dvalue)=1?value:''" oLevel1:DrawTickLines := 18/*exLevelLowerHalf+exLevelSolidLine*/ oLevel1:DrawTickLinesFrom(0,2/*exLevelSolidLine*/) oLevel1:Alignment := 1/*CenterAlignment*/ oBar := oChart:Bars:Item("Task") oBar:SetProperty("Color",0x2000000) oBar:Height := 18 oBar:OverlaidType := 515/*exOverlaidBarsStackAutoArrange+exOverlaidBarsStack*/ oBar:SetProperty("HistogramColor",0x1000000) oBar:HistogramType := 1/*exHistOverAllocation*/ oChart:HistogramVisible := .T. oChart:HistogramHeight := 48 oChart:HistogramView := 4/*exHistogramCheckedItems*/ oItems := oG2antt:Items() h := oItems:AddItem("Group <b>A</b>") oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/) oItems:SetProperty("CellMerge",h,0,1) oItems:AddBar(h,"Task","06/12/2009","06/19/2009","K1","Requirements") oItems:AddBar(h,"Task","06/13/2009","06/21/2009","K2","Sales & Marketing") oItems:SetProperty("ItemBar",h,"K1",33/*exBarColor*/,255) oItems:SetProperty("ItemBar",h,"K2",33/*exBarColor*/,255) oItems:SetProperty("CellState",h,0,1) h := oItems:AddItem("Group <b>B</b>") oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/) oItems:SetProperty("CellMerge",h,0,1) oItems:AddBar(h,"Task","06/14/2009","06/23/2009","K1","<b>GUI</b> Design") oItems:AddBar(h,"Task","06/18/2009","06/25/2009","K2","Class Design") h := oItems:AddItem("Group <b>C</b>") oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/) oItems:SetProperty("CellMerge",h,0,1) oItems:AddBar(h,"Task","06/12/2009","06/19/2009","K1","<b>GUI</b> Coding") oItems:AddBar(h,"Task","06/13/2009","06/25/2009","K2","Design & Concept") oItems:SetProperty("ItemBar",h,"K1",33/*exBarColor*/,65280) oItems:SetProperty("ItemBar",h,"K2",33/*exBarColor*/,65280) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
960 |
How can I remove all bars from the chart
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 3"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K2") oItems:ClearBars(0) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
959 |
How can I change the color for all bars with a specified key
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 3"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K2") oItems:SetProperty("ItemBar",0,"K1",33/*exBarColor*/,255) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
958 |
Is there any automatic way to change a property for all bars with a specified key
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 3"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K2") oItems:SetProperty("ItemBar",0,"K1",33/*exBarColor*/,255) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
957 |
How can I remove all bars with specified key
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 3"),"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K2") oItems:RemoveBar(0,"K1") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
956 |
How do I several bars with different vertical offsets
|
955 |
Is there any option to show gradient bars without using EBN technology
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oBar := oG2antt:Chart():Bars:Item("Task") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar:SetProperty("StartColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. )) oBar:SetProperty("EndColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. )) oBar:Pattern := 32/*exPatternBox*/ oItems := oG2antt:Items() h := oItems:AddItem("Task") oItems:AddBar(h,"Task","01/02/2001","01/05/2001","") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
954 |
How can I define a bar with border and solid filling
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oBar := oG2antt:Chart():Bars:Item("Task") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar:SetProperty("StartColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. )) oBar:SetProperty("EndColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. )) oBar:Pattern := 32/*exPatternBox*/ oItems := oG2antt:Items() h := oItems:AddItem("Task") oItems:AddBar(h,"Task","01/02/2001","01/05/2001","") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
953 |
How can I define a bar with border and solid filling
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oBar := oG2antt:Chart():Bars:Item("Task") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar:Pattern := 32/*exPatternBox*/ oBar:Height := 18 oItems := oG2antt:Items() h := oItems:AddItem("Task") oItems:AddBar(h,"Task","01/02/2001","01/05/2001","") oItems:SetProperty("ItemBar",h,"",7/*exBarBackColor*/,65535) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
952 |
How do I define a bar with solid border and filling
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:VisualAppearance():Add(1,"C:\Program Files\Exontrol\ExG2antt.NET\sample\EBN\blackboxt.ebn") oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oBar := oG2antt:Chart():Bars:Item("Task") oBar:SetProperty("Color",0x1000000) oBar:Height := 18 oItems := oG2antt:Items() h := oItems:AddItem("Task") oItems:AddBar(h,"Task","01/02/2001","01/05/2001","") oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,255) oItems:SetProperty("ItemBar",h,"",7/*exBarBackColor*/,65535) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
951 |
Can I control the units/resource/effort being allocated to a bar when displaying OverAllocation histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oColumn := oG2antt:Columns():Add("Effort") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,21) oColumn:Editor():EditType := 4/*SpinType*/ oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,96) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 202 oChart:HistogramView := 112/*exHistogramAllItems*/ oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 2050/*exRectangularCurve+exPatternDot*/ oBar:HistogramType := 1/*exHistOverAllocation*/ oBar:HistogramCriticalValue := 50 oBar:SetProperty("HistogramGridLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 192,192,192 } ) , .F. )) oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","06/21/2005","06/25/2005") oItems:SetProperty("CellValue",h1,1,2) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Task","06/24/2005","06/28/2005") oItems:SetProperty("CellValue",h1,1,1) h1 := oItems:AddItem("Task 3") oItems:AddBar(h1,"Task","06/27/2005","07/01/2005") oItems:SetProperty("CellValue",h1,1,2) h1 := oItems:AddItem("Task 4") oItems:AddBar(h1,"Task","06/30/2005","07/02/2005") oItems:SetProperty("CellValue",h1,1,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
950 |
Can I control the units/resource/effort being allocated to a bar when displaying Overload histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oColumn := oG2antt:Columns():Add("Effort") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,21) oColumn:Editor():EditType := 4/*SpinType*/ oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,96) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 128 oChart:HistogramView := 112/*exHistogramAllItems*/ oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := oBar:Pattern() oBar:HistogramType := 0/*exHistOverload*/ oBar:HistogramCriticalValue := 3 oBar:ShowHistogramValues := "value>3?255:1" oBar:HistogramItems := -11 oBar:SetProperty("HistogramGridLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 192,192,192 } ) , .F. )) oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","06/21/2005","06/23/2005") oItems:SetProperty("CellValue",h1,1,4) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Task","06/24/2005","06/26/2005") oItems:SetProperty("CellValue",h1,1,3) h1 := oItems:AddItem("Task 3") oItems:AddBar(h1,"Task","06/27/2005","06/29/2005") oItems:SetProperty("CellValue",h1,1,2) h1 := oItems:AddItem("Task 4") oItems:AddBar(h1,"Task","06/30/2005","07/02/2005") oItems:SetProperty("CellValue",h1,1,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
949 |
How can I display double-lines curves in the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AntiAliasing := .T. oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,48) oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 512/*exBezierCurve*/ oBar:HistogramItems := 3 oBar:SetProperty("HistogramBorderColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,0,0 } ) , .F. )) oBar:SetProperty("HistogramColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
948 |
Is there any option to display values in the histogram using different colors
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 6/*exPatternBDiagonal*/ oBar:HistogramItems := 6 oBar:ShowHistogramValues := "value>1?255:65280" oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/03/2001","01/07/2001") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
947 |
Is there any option to display values in the histogram using different colors
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 6/*exPatternBDiagonal*/ oBar:HistogramItems := 6 oBar:ShowHistogramValues := "value>1?255:1" oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/03/2001","01/07/2001") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
946 |
How can I display only few values in the histogram, such as the values greater than a value
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 6/*exPatternBDiagonal*/ oBar:ShowHistogramValues := "value>1" oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/03/2001","01/07/2001") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
945 |
How can I display values in the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 6/*exPatternBDiagonal*/ oBar:ShowHistogramValues := "1" oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/03/2001","01/07/2001") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
944 |
How can I scroll the chart to find a bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Column") oG2antt:Chart():LevelCount := 2 oG2antt:Chart():SetProperty("PaneWidth",.F.,64) oG2antt:DefaultItemHeight := 32 oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001",1) oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/02/2001","01/04/2001",2) oItems:AddBar(oItems:AddItem("Item 3"),"Task","01/02/2001","01/04/2001",3) oItems:AddBar(oItems:AddItem("Item 4"),"Task","01/02/2001","01/04/2001",4) oItems:AddBar(oItems:AddItem("Item 5"),"Task","01/02/2001","01/04/2001",5) oItems:AddBar(oItems:AddItem("Item 6"),"Task","01/02/2001","01/04/2001",6) oItems:AddBar(oItems:AddItem("Item 7"),"Task","01/02/2001","01/04/2001",7) oItems:AddBar(oItems:AddItem("Item 8"),"Task","01/02/2001","01/04/2001",8) oItems:AddBar(oItems:AddItem("Item 9"),"Task","01/02/2001","01/04/2001",8) oItems:AddBar(oItems:AddItem("Item 10"),"Task","01/02/2001","01/04/2001",10) oItems:AddBar(oItems:AddItem("Item 11"),"Task","01/02/2001","01/04/2001",11) oItems:AddBar(oItems:AddItem("Item 12"),"Task","01/02/2001","01/04/2001",12) oItems:AddBar(oItems:AddItem("Item 13"),"Task","01/02/2001","01/04/2001",13) oItems:AddBar(oItems:AddItem("Item 14"),"Task","01/02/2001","01/04/2001",14) h := oG2antt:Items:FindBar(14) oG2antt:Items():EnsureVisibleItem(h) oG2antt:Chart():ScrollTo(oG2antt:Items():ItemBar(h,14,1/*exBarStart*/),1) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
943 |
Can I change the color/marker/frame for selected bars
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oAppearance := oG2antt:VisualAppearance() oAppearance:Add(2,"c:\exontrol\images\normal.ebn") oAppearance:Add(1,"CP:2 3 2 -3 -2") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2002" oChart:SetProperty("SelBarColor",0x1000000) oChart:SetProperty("PaneWidth",.F.,48) oG2antt:Columns():Add("Task") oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/02/2002","01/04/2002","A") oItems:AddBar(h,"Task","01/06/2002","01/10/2002","B") oItems:AddBar(h,"Task","01/11/2002","01/14/2002","C") oItems:SetProperty("ItemBar",h,"A",257/*exBarSelected*/,.T.) oItems:SetProperty("ItemBar",h,"B",257/*exBarSelected*/,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
942 |
Can I display a larger marker for selected bars, eventually using the EBN technology
|
941 |
How do I change the color for the selected bars
|
940 |
How can I change the background color for child bars of a summary bar
|
939 |
How can I allow resizing the bar only in the right part of the bar
|
938 |
How can I allow resizing the bar only in the left part of the bar
|
937 |
How can I show the links that starts from selected bar being more visible, while the rest being transparent
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h1,h2,h3 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "09/20/2006" oChart:SetProperty("PaneWidth",.F.,64) oChart:SetProperty("ShowLinksWidth",1/*exShowLinksStartFrom*/,2) oChart:SetProperty("ShowLinksStyle",1/*exShowLinksStartFrom*/,2/*exLinkDot*/) oChart:SetProperty("ShowLinksColor",2/*exShowLinksEndTo*/,AutomationTranslateColor( GraMakeRGBColor ( { 200,200,200 } ) , .F. )) oChart:SetProperty("ShowLinksColor",4/*exShowUnselectedLinks*/,AutomationTranslateColor( GraMakeRGBColor ( { 200,200,200 } ) , .F. )) oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","09/21/2006","09/23/2006") h2 := oItems:AddItem("Task 2") oItems:AddBar(h2,"Task","09/25/2006","09/27/2006") oItems:SetProperty("ItemBar",h2,"",257/*exBarSelected*/,.T.) oItems:AddLink("L1",h1,"",h2,"") oItems:SetProperty("Link","L1",12/*exLinkText*/,"L1") h3 := oItems:AddItem("Task 3") oItems:AddBar(h3,"Task","09/29/2006","10/02/2006") oItems:AddLink("L2",h2,"",h3,"") oItems:SetProperty("Link","L2",12/*exLinkText*/,"L2") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
936 |
How can I show only the links that starts from selected bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h1,h2,h3 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:MarkSearchColumn := .F. oG2antt:OnResizeControl := 1/*exResizeChart*/ oG2antt:Columns():Add("Tasks") oG2antt:Columns():Add("Start"):Visible := .F. oG2antt:Columns():Add("End"):Visible := .F. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "09/20/2006" oChart:SetProperty("PaneWidth",.F.,64) oChart:SetProperty("ShowLinksColor",2/*exShowLinksEndTo*/,oChart:BackColor()) oChart:SetProperty("ShowLinksColor",4/*exShowUnselectedLinks*/,oChart:BackColor()) oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:SetProperty("CellValue",h1,1,"09/21/2006") oItems:SetProperty("CellValue",h1,2,"09/24/2006") oItems:AddBar(h1,"Task",oItems:CellValue(h1,1),oItems:CellValue(h1,2)) h2 := oItems:InsertItem(h,,"Task 2") oItems:SetProperty("CellValue",h2,1,"09/25/2006") oItems:SetProperty("CellValue",h2,2,"09/28/2006") oItems:AddBar(h2,"Task",oItems:CellValue(h2,1),oItems:CellValue(h2,2)) oItems:SetProperty("ItemBar",h2,"",257/*exBarSelected*/,.T.) oItems:AddLink("L1",h1,"",h2,"") h3 := oItems:InsertItem(h,,"Task 3") oItems:SetProperty("CellValue",h3,1,"09/29/2006") oItems:SetProperty("CellValue",h3,2,"10/02/2006") oItems:AddBar(h3,"Task",oItems:CellValue(h3,1),oItems:CellValue(h3,2)) oItems:AddLink("L2",h2,"",h3,"") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
935 |
How can I hide links that are not related to selected bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h1,h2,h3 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:MarkSearchColumn := .F. oG2antt:OnResizeControl := 1/*exResizeChart*/ oG2antt:Columns():Add("Tasks") oG2antt:Columns():Add("Start"):Visible := .F. oG2antt:Columns():Add("End"):Visible := .F. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "09/20/2006" oChart:SetProperty("PaneWidth",.F.,64) oChart:SetProperty("ShowLinksColor",4/*exShowUnselectedLinks*/,oChart:BackColor()) oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:SetProperty("CellValue",h1,1,"09/21/2006") oItems:SetProperty("CellValue",h1,2,"09/24/2006") oItems:AddBar(h1,"Task",oItems:CellValue(h1,1),oItems:CellValue(h1,2)) oItems:SetProperty("ItemBar",h1,"",257/*exBarSelected*/,.T.) h2 := oItems:InsertItem(h,,"Task 2") oItems:SetProperty("CellValue",h2,1,"09/25/2006") oItems:SetProperty("CellValue",h2,2,"09/28/2006") oItems:AddBar(h2,"Task",oItems:CellValue(h2,1),oItems:CellValue(h2,2)) oItems:AddLink("L1",h1,"",h2,"") h3 := oItems:InsertItem(h,,"Task 3") oItems:SetProperty("CellValue",h3,1,"09/29/2006") oItems:SetProperty("CellValue",h3,2,"10/02/2006") oItems:AddBar(h3,"Task",oItems:CellValue(h3,1),oItems:CellValue(h3,2)) oItems:AddLink("L2",h2,"",h3,"") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
934 |
How can I show the direction of the link using EBN files
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oChart LOCAL oItems LOCAL h1,h2 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oAppearance := oG2antt:VisualAppearance() oAppearance:Add(1,"c:\exontrol\images\normal.ebn") oAppearance:Add(2,"CP:1 -1 -1 1 1") oAppearance:Add(3,"CP:1 -2 -2 2 2") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,128) oG2antt:Columns():Add("Column") oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","B1") h2 := oItems:AddItem("Task 2") oItems:AddBar(h2,"Task","01/05/2001","01/13/2001","B2") oItems:AddLink("L1",h1,"B1",h2,"B2") oItems:SetProperty("Link","L1",14/*exLinkArrowColor*/,16777216) h2 := oItems:AddItem("Task 3") oItems:AddBar(h2,"Task","01/05/2001","01/13/2001","B3") oItems:AddLink("L2",h1,"B1",h2,"B3") oItems:SetProperty("Link","L2",14/*exLinkArrowColor*/,33554432) h2 := oItems:AddItem("Task 4") oItems:AddBar(h2,"Task","01/05/2001","01/13/2001","B5") oItems:AddLink("L3",h1,"B1",h2,"B5") oItems:SetProperty("Link","L3",14/*exLinkArrowColor*/,50331648) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
933 |
How can I show round links
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001","B1") oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/05/2001","01/13/2001","B2") oItems:AddLink("L1",oItems:FindItem("Item 1",0),"B1",oItems:FindItem("Item 2",0),"B2") oItems:SetProperty("Link","L1",15/*exLinkShowRound*/,.T.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
932 |
How can I change the color to display the arrow of the link
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001","B1") oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/06/2001","01/14/2001","B2") oItems:AddLink("L1",oItems:FindItem("Item 1",0),"B1",oItems:FindItem("Item 2",0),"B2") oItems:SetProperty("Link","L1",14/*exLinkArrowColor*/,255) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
931 |
I use UnitScale: exHour and I want to show only from 9 to 18 hour. The idea is to show only the working part of a day. Is this possible
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("MarkTodayColor",oChart:BackColor()) oChart:SetProperty("BackColorLevelHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oLevel := oChart:Level(0) oLevel:Label := "<b><%dddd%></b> <%d%>" oLevel:Alignment := 1/*CenterAlignment*/ oLevel:DrawTickLines := 0/*exLevelNoLine*/ oLevel1 := oChart:Level(1) oLevel1:Label := 65536 oLevel1:DrawTickLines := 65/*exLevelMiddleLine+exLevelDotLine*/ oLevel1:DrawTickLinesFrom(0,1/*exLevelDotLine*/) oChart:NonworkingHours := 16253439 oChart:ShowNonworkingUnits := .F. oChart:ShowNonworkingDates := .F. oChart:ShowNonworkingHours := .F. oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
930 |
Can I display tick lines from other level to my base level so time units gets separated more clearly
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:DrawLevelSeparator := 0/*exLevelNoLine*/ oChart:UnitWidth := 24 oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oLevel := oChart:Level(0) oLevel:Alignment := 1/*CenterAlignment*/ oLevel:Label := "<%dddd%>" oLevel:DrawTickLines := 18/*exLevelLowerHalf+exLevelSolidLine*/ oLevel1 := oChart:Level(1) oLevel1:Label := 65536 oLevel1:Count := 6 oLevel1:DrawTickLines := 66/*exLevelMiddleLine+exLevelSolidLine*/ oLevel1:DrawTickLinesFrom(0,2/*exLevelSolidLine*/) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
929 |
Is there any property to change the style of the tick lines being shown in the chart
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:UnitWidth := 24 oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oLevel := oChart:Level(0) oLevel:Alignment := 1/*CenterAlignment*/ oLevel:Label := "<%dddd%>" oLevel:DrawTickLines := 2/*exLevelSolidLine*/ oLevel1 := oChart:Level(1) oLevel1:Label := 65536 oLevel1:Count := 6 oLevel1:DrawTickLines := 34/*exLevelUpperHalf+exLevelSolidLine*/ oChart:DrawLevelSeparator := 2/*exLevelSolidLine*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
928 |
Is there any property to change the style of the tick lines being shown in the chart
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oChart:DrawLevelSeparator := 2/*exLevelSolidLine*/ oLevel := oChart:Level(0) oLevel:Label := "<%dddd%>" oLevel:DrawTickLines := 2/*exLevelSolidLine*/ oLevel1 := oChart:Level(1) oLevel1:Label := 65536 oLevel1:Count := 6 oLevel1:DrawTickLines := 2/*exLevelSolidLine*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
927 |
How can I show the levels based on the base level so tick lines aligns better
|
926 |
How can I show only working hours in other words only the working part of the day
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:AllowSelectDate := 0/*exNoSelectDate*/ oChart:SetProperty("MarkTodayColor",oChart:BackColor()) oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oLevel := oChart:Level(0) oLevel:Label := "<b><%dddd%></b> <%d%>" oLevel:Alignment := 1/*CenterAlignment*/ oLevel:DrawTickLines := 0/*exLevelNoLine*/ oLevel1 := oChart:Level(1) oLevel1:Label := 65536 oLevel1:SetProperty("ReplaceLabel","09","<fgcolor=FF0000><b><font ;10>9</font></b></fgcolor>") oChart:NonworkingHours := 16253439 oChart:ShowNonworkingUnits := .F. oChart:ShowNonworkingDates := .F. oChart:ShowNonworkingHours := .F. oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
925 |
How can I specify the effort for bars when displaying the overload histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,52) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:HistogramView := 112/*exHistogramAllItems*/ oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := oBar:Pattern() oBar:HistogramType := 0/*exHistOverload*/ oBar:HistogramItems := -6 oBar:SetProperty("HistogramGridLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 192,192,192 } ) , .F. )) oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","06/21/2005","06/23/2005","","4") oItems:SetProperty("ItemBar",h1,"",21/*exBarEffort*/,4) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Task","06/24/2005","06/26/2005","",3) oItems:SetProperty("ItemBar",h1,"",21/*exBarEffort*/,3) h1 := oItems:AddItem("Task 3") oItems:AddBar(h1,"Task","06/27/2005","06/29/2005","",2) oItems:SetProperty("ItemBar",h1,"",21/*exBarEffort*/,2) h1 := oItems:AddItem("Task 4") oItems:AddBar(h1,"Task","06/30/2005","07/02/2005","",1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
924 |
How can I display the cumulative histogram and showing the bars that generated it using different colors
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:SetProperty("PaneWidth",.F.,128) oChart:HistogramView := 1300/*exHistogramNoGrouping+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/ oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 1/*exPatternSolid*/ oBar:HistogramType := 256/*exHistCumulative*/ oBar:HistogramCumulativeOriginalColorBars := 0/*exChangeColor*/ oBar:HistogramItems := 6 oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,0,0 } ) , .F. )) oBar:SetProperty("HistogramBorderColor",AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. )) oColumn := oG2antt:Columns():Add("Column") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oItems := oG2antt:Items() h := oItems:AddItem("Project 1") oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/05/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 3"),"Task","01/04/2001","01/06/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 4"),"Task","01/02/2001","01/08/2001") oItems:SetProperty("CellState",oItems:ItemByIndex(1),0,1) oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
923 |
How can I show the cumulative histogram for my bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:SetProperty("PaneWidth",.F.,128) oChart:HistogramView := 1300/*exHistogramNoGrouping+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/ oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 1/*exPatternSolid*/ oBar:HistogramType := 256/*exHistCumulative*/ oBar:HistogramItems := 6 oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,0,0 } ) , .F. )) oBar:SetProperty("HistogramBorderColor",AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. )) oColumn := oG2antt:Columns():Add("Column") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oItems := oG2antt:Items() h := oItems:AddItem("Project 1") oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/05/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 3"),"Task","01/04/2001","01/06/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 4"),"Task","01/02/2001","01/08/2001") oItems:SetProperty("CellState",oItems:ItemByIndex(1),0,1) oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
922 |
How can I show some grid lines or ruler in the histogram
|
921 |
Is there any property to show some grid lines in the histogram
|
920 |
How can I specify a fixed number of bars/items being shown in the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:SetProperty("PaneWidth",.F.,78) oChart:HistogramView := 1300/*exHistogramNoGrouping+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/ oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 6/*exPatternBDiagonal*/ oBar:HistogramCriticalValue := 3 oBar:HistogramItems := -6 oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. )) oG2antt:Columns():Add("Column") oItems := oG2antt:Items() h := oItems:AddItem("Project 1") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/05/2001") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Project 2") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/04/2001","01/07/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/06/2001","01/08/2001") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Project 3") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/05/2001") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Project 4") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/04/2001","01/07/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/06/2001","01/08/2001") oItems:SetProperty("ExpandItem",h,.T.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
919 |
Is there any option to specify a minimum number of bars/items displayed in the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:SetProperty("PaneWidth",.F.,78) oChart:HistogramView := 1300/*exHistogramNoGrouping+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/ oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 6/*exPatternBDiagonal*/ oBar:HistogramItems := 6 oBar:SetProperty("HistogramGridLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. )) oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. )) oG2antt:Columns():Add("Column") oItems := oG2antt:Items() h := oItems:AddItem("Project 1") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/05/2001") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Project 2") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/04/2001","01/07/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/06/2001","01/08/2001") oItems:SetProperty("ExpandItem",h,.T.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
918 |
How can I show the histogram without grouping the bars based on their parents
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oChart:HistogramView := 1300/*exHistogramNoGrouping+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/ oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/ oG2antt:Columns():Add("Column") oItems := oG2antt:Items() h := oItems:AddItem("Project 1") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/05/2001") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Project 2") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/04/2001","01/07/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/06/2001","01/08/2001") oItems:SetProperty("ExpandItem",h,.T.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
917 |
How can I show the histogram for checked item and all recursively child items
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,128) oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 128 oChart:HistogramView := 788/*exHistogramRecLeafItems+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/ oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/ oG2antt:Columns():Add("Column") oItems := oG2antt:Items() h := oItems:AddItem("Project") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/05/2001") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:InsertItem(h,,"SubProject") oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/03/2001","01/07/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/05/2001","01/08/2001") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
916 |
How can I show the histogram for checked item and its child items
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oChart:HistogramView := 276/*exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/ oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/ oG2antt:Columns():Add("Column") oItems := oG2antt:Items() h := oItems:AddItem("Project") oItems:SetProperty("CellHasCheckBox",h,0,.T.) oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/07/2001") oItems:SetProperty("ExpandItem",h,.T.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
915 |
How can I show the histogram for all items
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SingleSel := .F. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:LevelCount := 2 oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oChart:HistogramView := 112/*exHistogramAllItems*/ oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/ oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
914 |
How can I prevent selecting a new item when clicking the chart area so my selection is shown in the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:SingleSel := .F. oChart := oG2antt:Chart() oChart:SelectOnClick := .F. oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oChart:HistogramView := 2/*exHistogramSelectedItems*/ oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/ oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001") oItems:SetProperty("SelectItem",oItems:ItemByIndex(0),.T.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
913 |
How can I show bars in the histogram for selected items only
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:SingleSel := .F. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oChart:HistogramView := 2/*exHistogramSelectedItems*/ oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/ oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001") oItems:SetProperty("SelectItem",oItems:ItemByIndex(0),.T.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
912 |
How can I change the color and size for the curve in the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,64) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 68 oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 258/*0x100+exPatternDot*/ oBar:SetProperty("HistogramBorderColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. )) oBar:HistogramBorderSize := 5 oItems := oG2antt:Items() h1 := oItems:AddItem("Task") oItems:AddBar(h1,"Task","06/21/2005","06/25/2005",1,1) oItems:AddBar(h1,"Task","06/23/2005","06/28/2005",2,2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
911 |
How can I change the color for the frame in the histogram
|
910 |
How can I force the histogram for a bar being shown all the time
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:ScrollBySingleLine := .T. oG2antt:Columns():Add("Tasks"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,64) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 68 oChart:HistogramView := 20/*exHistogramUnlockedItems+exHistogramCheckedItems*/ oBar := oChart:Bars():CallMethod("Copy","Task","H") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. )) oBar:HistogramPattern := 256/*0x100+*/ oBar:HistogramItems := 5 oBar:SetProperty("HistogramColor",oBar:Color()) oBar:SetProperty("HistogramGridLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oBar1 := oChart:Bars:Item("Task") oBar1:SetProperty("HistogramCriticalColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,128 } ) , .F. )) oBar1:HistogramPattern := oBar1:Pattern() oBar1:HistogramItems := 5 oBar1:SetProperty("HistogramGridLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oBar1:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oItems := oG2antt:Items() h1 := oItems:AddItem("Hidden") oItems:AddBar(h1,"H","06/23/2005","06/28/2005",1) oItems:AddBar(h1,"H","06/24/2005","06/26/2005",2) oItems:SetProperty("CellState",h1,0,1) oItems:SetProperty("ItemHeight",h1,0) oItems:SetProperty("SelectableItem",h1,.F.) h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","06/21/2005","06/25/2005",1) oItems:SetProperty("CellState",h1,0,1) h1 := oItems:AddItem("Task 2") oItems:SetProperty("CellState",h1,0,1) oItems:AddBar(h1,"Task","06/24/2005","07/01/2005",1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
909 |
How can I remove a bar type from the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1,oBar2 LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oBar := oChart:Bars:Item("Task") oBar:SetProperty("HistogramCriticalColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,128 } ) , .F. )) oBar:HistogramPattern := oBar:Pattern() oBar1 := oChart:Bars():CallMethod("Copy","Task","Green") oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. )) oBar1:HistogramPattern := oBar1:Pattern() oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Green","06/22/2005","06/26/2005",0) oItems:AddBar(h1,"Task","06/21/2005","06/25/2005",1) oItems:SetProperty("ItemBar",h1,1,18/*exBarOffset*/,3) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Green","06/28/2005","06/30/2005",0) oItems:AddBar(h1,"Task","06/27/2005","07/01/2005",1) oItems:SetProperty("ItemBar",h1,1,18/*exBarOffset*/,3) oBar2 := oG2antt:Chart():Bars:Item("Green") oBar2:SetProperty("HistogramColor",oBar2:Color()) oBar2:HistogramPattern := 0/*exPatternEmpty*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
908 |
How can I show the two buttons in the vertical splitter but still resizes the chart when the control gets resized
|
907 |
I have seen a screen shot on your web page that shows two buttons on the vertical scroll bar. How can I show them
|
906 |
How can I disable selecting a new item once the user clicks the chart area
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oG2antt:SingleSel := .F. oChart := oG2antt:Chart() oChart:SelectOnClick := .F. oChart:AllowCreateBar := 1/*exCreateBarAuto*/ oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 32 oChart:HistogramView := 2/*exHistogramSelectedItems*/ oChart:Bars:Item("Task"):HistogramPattern := 1/*exPatternSolid*/ oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","06/22/2005","06/26/2005",0) oItems:SetProperty("SelectItem",h1,.T.) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Task","06/24/2005","06/30/2005",0) oItems:SetProperty("SelectItem",h1,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
905 |
Is there any option to display the chart's header in the bottom side of the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramView := 112/*exHistogramAllItems*/ oChart:HistogramHeight := 96 oChart:HistogramHeaderVisible := .T. oBar := oChart:Bars:Item("Task") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,255 } ) , .F. )) oBar:OverlaidType := 1/*exOverlaidBarsOffset*/ oBar:OverlaidGroup := "Task2" oBar:SetProperty("HistogramCriticalColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,128 } ) , .F. )) oBar:HistogramPattern := 512/*exBezierCurve*/ oBar:HistogramType := 1/*exHistOverAllocation*/ oBar1 := oChart:Bars():CallMethod("Copy","Task","Task2") oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. )) oBar1:OverlaidType := 1/*exOverlaidBarsOffset*/ oBar1:OverlaidGroup := "Task" oBar1:SetProperty("HistogramCriticalColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,128,0 } ) , .F. )) oBar1:HistogramPattern := 512/*exBezierCurve*/ oBar1:HistogramType := 1/*exHistOverAllocation*/ oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task2","06/22/2005","06/26/2005",0) oItems:AddBar(h1,"Task","06/21/2005","06/25/2005",1) oItems:SetProperty("ItemBar",h1,0,21/*exBarEffort*/,3) oItems:SetProperty("ItemBar",h1,1,21/*exBarEffort*/,4) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Task2","06/28/2005","06/30/2005",0) oItems:AddBar(h1,"Task","06/27/2005","07/01/2005",1) oItems:SetProperty("ItemBar",h1,0,21/*exBarEffort*/,4) oItems:SetProperty("ItemBar",h1,1,21/*exBarEffort*/,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
904 |
How can I display the child bars as soon as an item gets collapsed
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h,h1,h2,h3 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "09/20/2006" oChart:ShowCollapsedBars := .T. oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,96) oItems := oG2antt:Items() h := oItems:AddItem("Project 1") h1 := oItems:InsertItem(h,,"Task 1") oItems:AddBar(h1,"Task","09/21/2006","09/23/2006","A") h2 := oItems:InsertItem(h,,"Task 2") oItems:AddBar(h2,"Task","09/24/2006","09/26/2006","B") h3 := oItems:InsertItem(h,,"Task 3") oItems:AddBar(h3,"Task","09/27/2006","09/29/2006","C") h := oItems:AddItem("Project 2") h1 := oItems:InsertItem(h,,"Task 1") oItems:AddBar(h1,"Task","09/21/2006","09/23/2006","A") h2 := oItems:InsertItem(h,,"Task 2") oItems:AddBar(h2,"Task","09/24/2006","09/26/2006","B") h3 := oItems:InsertItem(h,,"Task 3") oItems:AddBar(h3,"Task","09/27/2006","09/29/2006","C") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
903 |
What exBarEffort property represents
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/09/2005" oChart:HistogramVisible := .T. oChart:HistogramView := 112/*exHistogramAllItems*/ oChart:HistogramHeight := 164 oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 256/*0x100+*/ oBar:HistogramType := 1/*exHistOverAllocation*/ oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","06/10/2005","06/11/2005",,"1/1=<b>100%") oItems:SetProperty("ItemBar",h1,,4/*exBarHAlignCaption*/,18) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Task","06/12/2005","06/14/2005",,"1/2=<b>50%") oItems:SetProperty("ItemBar",h1,,4/*exBarHAlignCaption*/,18) h1 := oItems:AddItem("Task 3") oItems:AddBar(h1,"Task","06/15/2005","06/18/2005",,"1/3=<b>33%") oItems:SetProperty("ItemBar",h1,,4/*exBarHAlignCaption*/,18) h1 := oItems:AddItem("Task 4") oItems:AddBar(h1,"Task","06/19/2005","06/23/2005",,"1/4=<b>25%") oItems:SetProperty("ItemBar",h1,,4/*exBarHAlignCaption*/,18) h1 := oItems:AddItem("Task 5") oItems:AddBar(h1,"Task","06/24/2005","06/29/2005",,"1/5=<b>20%") oItems:SetProperty("ItemBar",h1,,4/*exBarHAlignCaption*/,18) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
902 |
Can I display multiple curves in the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramView := 112/*exHistogramAllItems*/ oChart:HistogramHeight := 64 oBar := oChart:Bars:Item("Task") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,255 } ) , .F. )) oBar:OverlaidType := 1/*exOverlaidBarsOffset*/ oBar:OverlaidGroup := "Task2" oBar:SetProperty("HistogramCriticalColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,128 } ) , .F. )) oBar:HistogramPattern := 512/*exBezierCurve*/ oBar:HistogramType := 1/*exHistOverAllocation*/ oBar1 := oChart:Bars():CallMethod("Copy","Task","Task2") oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. )) oBar1:OverlaidType := 1/*exOverlaidBarsOffset*/ oBar1:OverlaidGroup := "Task" oBar1:SetProperty("HistogramCriticalColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,128,0 } ) , .F. )) oBar1:HistogramPattern := 512/*exBezierCurve*/ oBar1:HistogramType := 1/*exHistOverAllocation*/ oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task2","06/22/2005","06/26/2005",0) oItems:AddBar(h1,"Task","06/21/2005","06/25/2005",1) oItems:SetProperty("ItemBar",h1,0,21/*exBarEffort*/,3) oItems:SetProperty("ItemBar",h1,1,21/*exBarEffort*/,4) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Task2","06/28/2005","06/30/2005",0) oItems:AddBar(h1,"Task","06/27/2005","07/01/2005",1) oItems:SetProperty("ItemBar",h1,0,21/*exBarEffort*/,4) oItems:SetProperty("ItemBar",h1,1,21/*exBarEffort*/,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
901 |
How can I use the exBarEffort property
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:HistogramView := 112/*exHistogramAllItems*/ oBar := oChart:Bars:Item("Task") oBar:SetProperty("HistogramCriticalColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar:HistogramPattern := 512/*exBezierCurve*/ oBar:HistogramType := 1/*exHistOverAllocation*/ oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","06/21/2005","06/25/2005") oItems:SetProperty("ItemBar",h1,"",21/*exBarEffort*/,4) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Task","06/27/2005","07/01/2005") oItems:SetProperty("ItemBar",h1,"",21/*exBarEffort*/,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |